<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表单js实现</title>
    <style>
        h2{
            text-align: center;
        }
        table{
            margin: 0 auto;
            height: 80px;
            border-collapse: collapse;
        }
        th{
            border: 1px solid black;
            padding:15px
        }
    </style>
</head>
<body>
    <h2>订单确认</h2>
    <table id="table">
        <tr>
            <th>商品名称</th>
            <th>商品价格</th>
            <th>商品数量</th>
            <th>总价</th>
            <th>收货地址</th>
        </tr>
        <tr>
            <th>{{goods}}</th>
            <th>{{price}}元</th>
            <th>{{num}}</th>
            <th>{{total}}元</th>
            <th>{{address}}</th>
        </tr>
    </table>
    <script src="vue.js"></script>
    <script>
        let price = Number(prompt('价格'))
        let num = Number(prompt('买入数量'))
        let address = prompt('收获地址')
        const table = new Vue({
            el:'#table',
            data:{
                goods:'vivo手机pro',
                price:price,
                num:num,
                total:price * num,
                address:address
            }
        })

    </script>
</body>
</html>
